welo git mirrors
Commit d5a577f5412c0719b28ae9b3a4c2d9284a6d5b63
Parents : ec969d9
Author : welo | main nixos computer <empty@empty.com>
Date : 2026-07-07T13:44:20+01:00
print test
Changes
6 files changed, 334 insertions(+), 78 deletions(-)
Diff
diff --git a/src/client.rs b/src/client.rs
index 4fba13c..033ccff 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -26,8 +26,10 @@ use rns_net::{LinkId, RnsNode};
use tokio::net::{TcpListener, TcpStream, UdpSocket};
use tokio::sync::mpsc::UnboundedReceiver;
use tokio::sync::{mpsc, Notify};
+use tokio::time::error::Elapsed;
-use crate::forwarding::{ForwardedPort, tcp_tunnel};
+use crate::forwarding::ForwardedPortType::{self, Tcp};
+use crate::forwarding::{ForwardedPort, tcp_tunnel, udp_tunnel};
use crate::mux::MuxHandle;
use crate::{
Frame, FrameType, ProxyEvent, create_node, encode_connect_payload, ensure_path, recall_sig_pub, relay_bidirectional_tcp, relay_bidirectional_udp
@@ -49,12 +51,16 @@ pub async fn run_client_forward(server_hex: &str, ports: Vec<ForwardedPort> ) {
println!("destinations");
for port in ports {
- if true {
- tcp_tunnel(mux.clone(), reconnect_notify.clone(), port).await
- }
-
- if false {
-
+ match port.r#type {
+ ForwardedPortType::Tcp => {
+ tcp_tunnel(mux.clone(), reconnect_notify.clone(), port).await
+ },
+ ForwardedPortType::Udp => {
+ udp_tunnel(mux.clone(), reconnect_notify.clone(), port).await
+ },
+ ForwardedPortType::TcpUdp => {
+
+ }
}
}
// run_sockets_proxy_handling(listen_addr, mux.clone(), reconnect_notify).await;
@@ -134,7 +140,9 @@ pub async fn run_sockets_proxy_handling(listen_addr: &str, mux: MuxHandle, recon
};
- let buf = &mut [0u8 ;65536];
+ println!("started listener {}", listen_addr);
+
+ // let buf = &mut [0u8 ;65536];
// Accept SOCKS5 connections
loop {
tokio::select! {
@@ -333,33 +341,34 @@ async fn handle_socks5_session(
{if let Some(stream) = handle_tcp_connect(sid, mux.clone(), &mut session_rx, proto, target_addr).await {
relay_bidirectional_tcp(sid, stream, mux, session_rx).await
}},
- Socks5Command::UDPAssociate => handle_udp_connect(sid, mux, session_rx, proto, target_addr).await,
+ Socks5Command::UDPAssociate =>
+ {if let Some((udp_stream,stream)) = handle_udp_connect(sid, mux.clone(), &mut session_rx, proto, target_addr).await {
+ relay_bidirectional_udp(sid, udp_stream, Some(stream), mux, session_rx, true).await;
+ }},
+
Socks5Command::TCPBind => {_ = proto.reply_error(&ReplyError::CommandNotSupported).await;}
// I'll be real I don't know what tcp bind is actually for, so it can just be an error
}
}
-async fn handle_udp_connect(
+
+pub async fn udp_bind_connect(
sid: u32,
mux: MuxHandle,
- mut session_rx: mpsc::UnboundedReceiver<Frame>,
- proto: Socks5ServerProtocol<TcpStream,CommandRead>,
-
- target_addr: TargetAddr,
-) {
- // info!("udp test data: {:?}, {:?}",cmd, target_addr);
-
- // Extract host and port from TargetAddr
+ session_rx: &mut mpsc::UnboundedReceiver<Frame>,
+ target_addr: TargetAddr,)
+ -> Result<Result<(),String>,Elapsed>
+{
let (host, port) = target_addr.into_string_and_port();
info!("[{}] -> {}:{}", sid, host, port);
-
+
// Send CONNECT frame through RNS
let connect_payload = encode_connect_payload(&host, port, true);
mux.send(FrameType::Connect, sid, connect_payload);
// Wait for CONN_OK or CONN_ERR with timeout
- let connect_result = tokio::time::timeout(Duration::from_secs(15), async {
+ tokio::time::timeout(Duration::from_secs(15), async {
while let Some(frame) = session_rx.recv().await {
match frame.frame_type {
FrameType::ConnectOk => return Ok(()),
@@ -372,8 +381,22 @@ async fn handle_udp_connect(
}
Err("channel closed".to_string())
})
- .await;
+ .await
+}
+
+async fn handle_udp_connect(
+ sid: u32,
+ mux: MuxHandle,
+ mut session_rx: &mut mpsc::UnboundedReceiver<Frame>,
+ proto: Socks5ServerProtocol<TcpStream,CommandRead>,
+
+ target_addr: TargetAddr,
+) -> Option<(UdpSocket, TcpStream)> {
+ // info!("udp test data: {:?}, {:?}",cmd, target_addr);
+ // Extract host and port from TargetAddr
+
+ let connect_result = udp_bind_connect(sid,mux.clone(), &mut session_rx, target_addr).await;
// Reply to SOCKS5 client based on RNS connection result
let udp_stream = UdpSocket::bind(format!("0.0.0.0:0")).await.expect("unable to get udp socket");
@@ -381,16 +404,16 @@ async fn handle_udp_connect(
let relay_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), relay_port);
- let stream = match connect_result {
+ match connect_result {
Ok(Ok(())) => {
// Connection succeeded -- send SOCKS5 success reply
match proto.reply_success(relay_address).await {
- Ok(s) => s,
+ Ok(s) => Some((udp_stream,s)),
Err(e) => {
debug!("[{}] Failed to send SOCKS5 reply: {:?}", sid, e);
mux.send(FrameType::Close, sid, Vec::new());
mux.drop_session(sid);
- return;
+ return None;
}
}
}
@@ -398,31 +421,27 @@ async fn handle_udp_connect(
warn!("[{}] Remote connect failed: {}", sid, reason);
let _ = proto.reply_error(&ReplyError::GeneralFailure).await;
mux.drop_session(sid);
- return;
+ return None;
}
Err(_) => {
warn!("[{}] Connect timeout", sid);
let _ = proto.reply_error(&ReplyError::TtlExpired).await;
mux.drop_session(sid);
- return;
+ return None;
}
- };
+ }
- relay_bidirectional_udp(sid, udp_stream, Some(stream), mux, session_rx, true).await;
}
-async fn handle_tcp_connect(
+pub async fn connect_tcp_server_side(
sid: u32,
mux: MuxHandle,
session_rx: &mut mpsc::UnboundedReceiver<Frame>,
- proto: Socks5ServerProtocol<TcpStream,CommandRead>,
- target_addr: TargetAddr,
-) -> Option<TcpStream> {
- // info!("udp test data: {:?}, {:?}",cmd, target_addr);
-
- // Extract host and port from TargetAddr
+ target_addr: TargetAddr,)
+ -> Result<Result<(),String>,Elapsed>
+{
let (host, port) = target_addr.into_string_and_port();
info!("[{}] -> {}:{}", sid, host, port);
@@ -432,7 +451,7 @@ async fn handle_tcp_connect(
mux.send(FrameType::Connect, sid, connect_payload);
// Wait for CONN_OK or CONN_ERR with timeout
- let connect_result = tokio::time::timeout(Duration::from_secs(15), async {
+ tokio::time::timeout(Duration::from_secs(15), async {
while let Some(frame) = session_rx.recv().await {
match frame.frame_type {
FrameType::ConnectOk => return Ok(()),
@@ -445,8 +464,21 @@ async fn handle_tcp_connect(
}
Err("channel closed".to_string())
})
- .await;
+ .await
+}
+
+async fn handle_tcp_connect(
+ sid: u32,
+ mux: MuxHandle,
+ session_rx: &mut mpsc::UnboundedReceiver<Frame>,
+ proto: Socks5ServerProtocol<TcpStream,CommandRead>,
+ target_addr: TargetAddr,
+) -> Option<TcpStream> {
+ // info!("udp test data: {:?}, {:?}",cmd, target_addr);
+
+
+ let connect_result = connect_tcp_server_side(sid,mux.clone(), session_rx, target_addr).await;
// Reply to SOCKS5 client based on RNS connection result
let dummy_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0);
diff --git a/src/forwarding.rs b/src/forwarding.rs
index c8b9f2d..d1c59da 100644
--- a/src/forwarding.rs
+++ b/src/forwarding.rs
@@ -18,41 +18,197 @@
//!
//!
-use std::sync::Arc;
+use std::{net::{Ipv4Addr, SocketAddr}, sync::Arc};
+use fast_socks5::util::target_addr::TargetAddr;
use log::{error, info, warn};
-use tokio::{net::TcpListener, sync::Notify};
+use tokio::{net::{TcpListener, UdpSocket}, sync::{Notify, mpsc::{UnboundedReceiver, UnboundedSender, channel, unbounded_channel}}};
+use udp_stream::UdpListener;
-use crate::{mux::MuxHandle, relay::relay_forwarded_tcp};
+use crate::{client::{connect_tcp_server_side, udp_bind_connect}, mux::MuxHandle, relay::{relay_forwarded_tcp, relay_forwarded_udp}};
+pub enum ForwardedPortType {
+ Tcp,
+ Udp,
+ TcpUdp, // both
+}
pub struct ForwardedPort {
pub server_port: u16,
- pub client_port: u16
+ pub client_port: u16,
+ pub r#type: ForwardedPortType
}
+pub async fn udp_tunnel(mux: MuxHandle, reconnect_notify: Arc<Notify> , port: ForwardedPort) {
+ let target_addr = SocketAddr::new(std::net::IpAddr::V4(Ipv4Addr::LOCALHOST), port.client_port);
+ let listener = match UdpListener::bind(target_addr).await {
+ Ok(l) => l,
+ Err(e) => {
+ error!("Failed to local port at {}", port.client_port);
+ return;
+ }
+ };
+
+
+ let reference = &mux;
+
+ loop {
+ tokio::select! {
+ accept_result = listener.accept() => {
+ let (stream, addr) = match accept_result {
+ Ok(sa) => sa,
+ Err(e) => {
+ continue;
+ }
+ };
+ let mux = reference.clone();
+ if !mux.is_connected() {
+ drop(stream);
+ continue;
+ }
+
+ let sid = mux.next_session_id();
+ let mut session_rx = mux.register_session(sid);
+ let mux_clone = mux.clone();
+
+ // let connect_result = udp_bind_connect(sid,mux.clone(), &mut session_rx, target_addr).await;
+
+ let target_addr = TargetAddr::Ip(SocketAddr::new(std::net::IpAddr::V4(Ipv4Addr::LOCALHOST), port.server_port ));
-pub async fn udp_tunnel(server_port: u16, client_port: u16) {
- // 1. open up udp listener
- // 2. have a mutex list of all the udps associated with each server and client ports
- // when a new udp port fires to the localhost port, UDP associate to get a corresponding
- // udp port server side.
- // 3. When you get a new udp packet from the socket, find the associated sid and mux
- // from the mutex list.
- // 4. when we receive a packet we should know based on the sid and mux which udp localhost
- // port that is associated with and we can just pass it through.
+ tokio::spawn(async move {
+ if let Ok(_) = udp_bind_connect(sid, mux.clone(), &mut session_rx, target_addr ).await {
+ relay_forwarded_udp(sid, stream, mux_clone, session_rx).await;
+ }
+ });
+ }
+ _ = reconnect_notify.notified() => {
+ // Link was re-established, just continue accepting
+ info!("port {} back", port.client_port);
+ }
+
+ }
+ }
}
-pub async fn tcp_tunnel(mux: MuxHandle, reconnect_notify: Arc<Notify> , port: ForwardedPort) {
+/// 1. open up udp listener
+/// 2. have a mutex list of all the udps associated with each server and client ports
+/// when a new udp port fires to the localhost port, UDP associate to get a corresponding
+/// udp port server side.
+/// 3. When you get a new udp packet from the socket, find the associated sid and mux
+/// from the mutex list.
+/// 4. when we receive a packet we should know based on the sid and mux which udp localhost
+/// port that is associated with and we can just pass it through.
+///
+///
+/// This implementation is very weird compared to the others cause we can't seperate every udp into
+/// different streams and unlike the standard socksv5 implementation we don't have a seperate relay port
+/// for every program trying to use udp, so the pattern that works for rest of the functions doesn't work
+/// so instead we just handle everything in one function and don't use tokio:spawn which means it's
+/// single threaded and a bit more inefficient.
+///
+/// Note, we don't bother with reconnect_notify cause udp is lossy anyways. If it doesn't get through
+/// then too bad. better to ignore it than to unbind the udp socket or something.
+/// the only other alternative is buffering the udp but I'm not bothering, the application layer
+/// can deal with 100% packet loss for like 5 seconds probs.
+///
+/// Note 2, we have no way of telling the server we are done with udp directly as it's connectionless but we
+/// could therotically ask the OS if that localhost udp socket we are receiving from is still open and figure
+/// out if we can safely tell the server to delete that port in the lsit. Cause right now they just stay
+/// till we disconnect the RNS link or we end the program, so we therotically could run out of
+/// udp ports server side. Not really that much of a concern cause we should have a server side
+/// limit anyways.
+// pub async fn udp_tunnel(mux: MuxHandle, reconnect_notify: Arc<Notify> , port: ForwardedPort) {
+
+// let listener = match UdpSocket::bind(format!("127.0.0.1:{}",port.client_port)).await {
+// Ok(l) => l,
+// Err(e) => {
+// error!("Failed to local udp port at {}", port.client_port);
+// return;
+// }
+// };
+
-// basically:
-// 1. open up tcp listener
-// 2. every type a program like a webpage tries to connect to the local socket
-// it must be from a different tcp port. So we know what program is what based on that.
-// so we send a connect request to the reticulm server socks server a CONNECT request
-// 3. any time a new tcp packet arrives then add the destination localhost port of the reticulum server
-// and any time we receive data we figure out which stream it corresponds to and send it back
-
+// let mut port_mapping: Vec<(u32,u16, UnboundedSender<Vec<u8>>)> = Vec::new();
+// // sid, local port number, sender from localhost udp to rns.
+
+// loop {
+// let mut buf = [0u8 ;65536]; // probably inefficient?
+// let accept_result = listener.recv_from(&mut buf).await;
+// let (size, addr) = match accept_result {
+// Ok(sa) => sa,
+// Err(e) => {
+// continue;
+// }
+// };
+// // let data = &(buf[..size]);
+// let associated_port = port_mapping.iter().find(|p| {p.1 == addr.port()} );
+// match associated_port {
+// Some((sid, client_port, sender)) => { // either it already exists in the mapping
+// let mut data = vec![];
+// data.extend_from_slice(&buf[..size]);
+// println!("{:?}", sender.send(data));
+// },
+// None => {
+// // let
+// let (sender, receiver) = unbounded_channel();
+// //
+// // put the thing into port_mapping;
+// port_mapping.push((0,addr.port(), sender));
+
+
+// if !mux.is_connected() {
+// warn!("No RNS UDP link, rejecting connection");
+// continue;
+// }
+
+// let sid = mux.next_session_id();
+// let session_rx = mux.register_session(sid);
+// let mux_clone = mux.clone();
+
+// tokio::spawn(async move {
+// handle_socks5_session(sid, stream, mux_clone, session_rx).await;
+// });
+// },
+// };
+
+
+
+
+// // let mux = reference.clone();
+// // if !mux.is_connected() {
+// // drop(stream);
+// // continue;
+// // }
+
+// // let sid = mux.next_session_id();
+// // let mut session_rx = mux.register_session(sid);
+// // let mux_clone = mux.clone();
+
+// // println!("{:?} {:?}", sid, addr);
+// // let target_addr = TargetAddr::Ip(SocketAddr::new(std::net::IpAddr::V4(Ipv4Addr::LOCALHOST), port.server_port ));
+
+// // tokio::spawn(async move {
+// // if let Ok(_) = connect_tcp_server_side(sid, mux.clone(), &mut session_rx, target_addr ).await {
+// // relay_forwarded_tcp(sid, stream, mux_clone, session_rx).await;
+// // }
+// // });
+
+// }
+// // note, this implementation doesn't actually do this. We assign one pory server side and that's
+// // it and the implementation only works when a single program is using the udp port. Otherwise
+// // we have to create a new udp socket server side for every single application
+// }
+
+/// basically:
+/// 1. open up tcp listener
+/// 2. every type a program like a webpage tries to connect to the local socket
+/// it must be from a different tcp port. So we know what program is what based on that.
+/// so we send a connect request to the reticulm server socks server a CONNECT request
+/// 3. any time a new tcp packet arrives then add the destination localhost port of the reticulum server
+/// and any time we receive data we figure out which stream it corresponds to and send it back
+///
+///
+pub async fn tcp_tunnel(mux: MuxHandle, reconnect_notify: Arc<Notify> , port: ForwardedPort) {
let listener = match TcpListener::bind(format!("127.0.0.1:{}",port.client_port)).await {
Ok(l) => l,
Err(e) => {
@@ -62,8 +218,8 @@ pub async fn tcp_tunnel(mux: MuxHandle, reconnect_notify: Arc<Notify> , port: Fo
};
- let buf = &mut [0u8 ;65536];
- // Accept SOCKS5 connections
+ let reference = &mux;
+
loop {
tokio::select! {
accept_result = listener.accept() => {
@@ -73,19 +229,23 @@ pub async fn tcp_tunnel(mux: MuxHandle, reconnect_notify: Arc<Notify> , port: Fo
continue;
}
};
+ let mux = reference.clone();
if !mux.is_connected() {
drop(stream);
continue;
}
let sid = mux.next_session_id();
- let session_rx = mux.register_session(sid);
+ let mut session_rx = mux.register_session(sid);
let mux_clone = mux.clone();
println!("{:?} {:?}", sid, addr);
+ let target_addr = TargetAddr::Ip(SocketAddr::new(std::net::IpAddr::V4(Ipv4Addr::LOCALHOST), port.server_port ));
tokio::spawn(async move {
- relay_forwarded_tcp(sid, stream, mux_clone, session_rx).await;
+ if let Ok(_) = connect_tcp_server_side(sid, mux.clone(), &mut session_rx, target_addr ).await {
+ relay_forwarded_tcp(sid, stream, mux_clone, session_rx).await;
+ }
});
}
_ = reconnect_notify.notified() => {
diff --git a/src/main.rs b/src/main.rs
index 5fa555b..9b21d90 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,7 +4,7 @@
//! Run as either a server (exit node) or client (local SOCKS5 proxy).
use clap::Parser;
-use rns_proxy::{cli::{Cli, Commands}, client::run_client_forward, forwarding::ForwardedPort};
+use rns_proxy::{cli::{Cli, Commands}, client::run_client_forward, forwarding::{ForwardedPort, ForwardedPortType}};
#[tokio::main]
async fn main() {
@@ -26,10 +26,12 @@ async fn main() {
} => {
rns_proxy::client::run_client(&destination, &listen).await;
}
- Commands::Forward { destination, ports } => {
+ Commands::Forward { destination, ports} => {
run_client_forward(&destination, vec![ForwardedPort{
- server_port: 7657,
- client_port: 7657
+ server_port: 44444,
+ client_port: 44444,
+ r#type: ForwardedPortType::Udp
+
}]).await;
// rns_proxy::server::run_server(identity_file.as_deref()).await;
}
diff --git a/src/mux.rs b/src/mux.rs
index 3b90d3d..826fff2 100644
--- a/src/mux.rs
+++ b/src/mux.rs
@@ -141,7 +141,7 @@ impl MuxHandle {
debug!("Session {} channel closed", sid);
}
} else {
- debug!("No session {} for frame type {}", sid, ft);
+ warn!("No session {} for frame type {}", sid, ft);
}
}
diff --git a/src/relay.rs b/src/relay.rs
index 736882b..6945537 100644
--- a/src/relay.rs
+++ b/src/relay.rs
@@ -1,6 +1,7 @@
//! Bidirectional TCP ↔ RNS relay — used by both client and server sessions.
use std::net::{Ipv4Addr, ToSocketAddrs};
+use std::str::SplitWhitespace;
use std::sync::Arc;
use std::time::Duration;
@@ -10,6 +11,7 @@ use log::{debug, error, warn};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::unix::SocketAddr;
use tokio::sync::{Mutex, mpsc};
+use udp_stream::UdpStream;
use crate::frame::{Frame, FrameType};
use crate::mux::MuxHandle;
@@ -73,15 +75,15 @@ pub async fn relay_bidirectional_tcp(
-// udp must still have an associated tcp connection to detect when the connection is over.
-// this does not apply to the server (as in rns server) as it detects that the frame is being closed
-// udp doesn't have a connetcion so the server cannot detect that the remote server the client is connecting
-// to is offline per say.
-//
-// basically, the client can stop the udp connection either by the reticulum link breaking
-// OR the process using the udp connection stops
-// while the server only stops in the first scenario because the server cannot know if the remote
-// server not responding is part of the protocol.
+/// udp must still have an associated tcp connection to detect when the connection is over.
+/// this does not apply to the server (as in rns server) as it detects that the frame is being closed
+/// udp doesn't have a connetcion so the server cannot detect that the remote server the client is connecting
+/// to is offline per say.
+///
+/// basically, the client can stop the udp connection either by the reticulum link breaking
+/// OR the process using the udp connection stops
+/// while the server only stops in the first scenario because the server cannot know if the remote
+/// server not responding is part of the protocol.
pub async fn relay_bidirectional_udp(
sid: u32,
socket: tokio::net::UdpSocket,
@@ -322,7 +324,63 @@ pub async fn relay_forwarded_tcp(
mux.send(FrameType::Close, sid, Vec::new());
mux.drop_session(sid);
+}
+pub async fn relay_forwarded_udp(
+ sid: u32,
+ stream: UdpStream, // stream between local forwarded port and the port
+ // of whatever application is connecting to it.
+ mux: MuxHandle,
+ mut session_rx: mpsc::UnboundedReceiver<Frame>)
+{
+ let mux_fwd = mux.clone();
+
+
+ let (mut udp_read,mut udp_write) = tokio::io::split(stream);
+
+ // TCP -> RNS
+ let tcp_to_rns = tokio::spawn(async move {
+ let mut buf = [0u8; 4096];
+ loop {
+ match udp_read.read(&mut buf).await {
+ Ok(0) => break,
+ Ok(n) => {
+ println!("{:?} {:?}", sid, &buf[..n]);
+ mux_fwd.send(FrameType::Data, sid, buf[..n].to_vec());
+ }
+ Err(e) => {
+ debug!("[{}] TCP read error: {}", sid, e);
+ break;
+ }
+ }
+ }
+ });
+ // RNS -> TCP
+ let rns_to_tcp = tokio::spawn(async move {
+ while let Some(frame) = session_rx.recv().await {
+ match frame.frame_type {
+ FrameType::Data => {
+ println!("{:?}", &frame.payload);
+ if let Err(e) = udp_write.write_all(&frame.payload).await {
+ warn!("[{}] TCP write error: {}", sid, e);
+ break;
+ }
+ }
+ FrameType::Close => break,
+ _ => {}
+ }
+ }
+ });
+
+ tokio::select! {
+ _ = tcp_to_rns => {},
+ _ = rns_to_tcp => {},
+ }
+
+ mux.send(FrameType::Close, sid, Vec::new());
+ mux.drop_session(sid);
}
+
+
diff --git a/src/server.rs b/src/server.rs
index c21afe3..1e8b9ae 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -33,6 +33,7 @@ const DEFAULT_IDENTITY_FILENAME: &str = "rns_proxy_identity";
///
/// If `override_path` is given, uses it as-is. Otherwise defaults to
/// `~/.reticulum/<DEFAULT_IDENTITY_FILENAME>`.
+
fn identity_file_path(override_path: Option<&str>) -> PathBuf {
match override_path {
Some(p) => PathBuf::from(p),
@@ -188,6 +189,7 @@ pub async fn run_server(identity_path: Option<&str>) {
}
}
FrameType::Data | FrameType::Close => {
+ println!("frame: {:?}",frame);
mux.dispatch(frame);
}
_ => {}
@@ -227,7 +229,7 @@ async fn handle_server_session_tcp(
info!("[{}] TCP Closed", sid);
}
-/// Handle a single proxied TCP session on the server side.
+/// Handle a single proxied UDP session on the server side.
async fn handle_server_session_udp(
sid: u32,
host: String,
@@ -239,6 +241,8 @@ async fn handle_server_session_udp(
// generally the udp socket will connect to 0.0.0.0:0 to allow to send and receive from
// every port. We don't police which sockets are valid here.
+
+ println!("{}:{}",host,port);
let socket = match UdpSocket::bind(format!("{}:{}",host,port)).await {
Ok(s) => s,
Err(e) => {
Served by rngit 1.4.2 - Generated in 0.03s